package com.cdd.index.controller;

import com.cdd.index.service.IBottomArticleService;
import com.common.entity.BottomArticle;
import com.common.entity.HeadNav;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/index/BottomArticle")
public class BottomArticleController {

    @Autowired
    private IBottomArticleService bottomArticleService;

    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody BottomArticle bottomArticle) {
        return bottomArticleService.selectAll(currentPage,pageSize,bottomArticle);
    }
    @PostMapping("/findAll")
    public CommonResult findAll(){
        return bottomArticleService.findAll();
    }

    @PostMapping("/updateStatus/{id}/{isDisable}")
    public CommonResult updateStatus(@PathVariable String id,@PathVariable Integer isDisable){
        return bottomArticleService.updateStatus(id,isDisable);
    }

    @PostMapping("/BottomArticleAdd")
    public CommonResult BottomArticleAdd(@RequestBody BottomArticle bottomArticle) {
        return bottomArticleService.BottomArticleAdd(bottomArticle);
    }
    @PostMapping("/updateBottomArticle")
    public CommonResult updateBottomArticle(@RequestBody BottomArticle bottomArticle){
        return bottomArticleService.updateBottomArticle(bottomArticle);
    }
    @PostMapping("/deleteBottomArticle/{id}")
    public CommonResult deleteBottomArticle(@PathVariable String id){
        return bottomArticleService.deleteBottomArticle(id);
    }

}